import path from 'path';
import { defineConfig } from 'umi';
import routes from './route.config';

console.log(path.resolve(__dirname, '../models/index.js'));

export default defineConfig({
  history: { type: 'hash' },
  outputPath: path.join(__dirname, '../../../dist/renderer'), 
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  // alias: {
  //   '@renderer': path.resolve(__dirname, '../../renderer'),
  // },
  routes: routes,
  plugins: [
    '@umijs/plugins/dist/antd',
    '@umijs/plugins/dist/dva',
  ],
  antd:{
    import: true,
  },
  // dva:{},
  dva:{
    immer: {
      enable: true, 
    },
    hmr: {
      enable: true, 
    },
    // extraModels:[path.resolve(__dirname, '../models/index.js')],
  },
});
